From e13a378a9d41f4c902633ba230d968d54433c2c7 Mon Sep 17 00:00:00 2001 From: justbur Date: Thu, 5 May 2016 10:30:44 -0400 Subject: [PATCH] Backport two frame width functions for 24.3 support Fixes #119 --- which-key.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/which-key.el b/which-key.el index 6788d0168af..c0bf5eca2be 100644 --- a/which-key.el +++ b/which-key.el @@ -2161,5 +2161,24 @@ Finally, show the buffer." (cancel-timer which-key--paging-timer) (which-key--start-timer)))))) +;; backport some functions for 24.3 + +;; found at https://github.com/Lindydancer/andersl-old-emacs-support/blob/master/andersl-old-emacs-support.el +(unless (fboundp 'frame-fringe-width) + (defun frame-fringe-width (&optional frame) + "Return fringe width of FRAME in pixels." + (let ((left-pair (assq 'left-fringe (frame-parameters frame))) + (right-pair (assq 'right-fringe (frame-parameters frame)))) + (+ (if left-pair (cdr left-pair) 0) + (if right-pair (cdr right-pair) 0))))) + +(unless (fboundp 'frame-scroll-bar-width) + (defun frame-scroll-bar-width (&optional frame) + "Return scroll bar width of FRAME in pixels." + (let ((pair (assq 'scroll-bar-width (frame-parameters frame)))) + (if pair + (cdr pair) + 0)))) + (provide 'which-key) ;;; which-key.el ends here -- 2.30.2